package com.spring.boot.controller;

import com.spring.boot.po.User;
import com.spring.boot.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by liuaiguo on 2016/12/7.
 */
@Controller
public class TestController {

    @Autowired
    private UserService userService;

    @RequestMapping(value = "getUser")
    @ResponseBody
    public User getUser(){
        User user = new User(1L,"admin",66);
        userService.save(user);
        return userService.findById(1L);
    }

    @RequestMapping(value = "chat")
    public String chat(){
        return "chat";
    }


}
